<?php
/**
 * Create By: PhpStorm
 * User: niechenguang
 * File: GetCircle.php
 * Date: 2017/1/2
 * Time: 23:13
 */

namespace app\api\model\page\msg;

use app\api\model\dao\MsgSet;
use app\library\Error;
use app\library\PageBase;
use think\Exception;
use think\Validate;

class SetMsgSet extends PageBase
{
    private $objMsgSet;

    public function __construct()
    {
        parent::__construct();

        $this->objMsgSet = new MsgSet();

    }

    /**
     * page 入口
     *
     * @param $param
     * @return array
     * @throws Exception
     */
    public function excute($param)
    {
        $ret = $this->checkToken($param);
        if (false === $ret) {
            return $this->getRes(Error::ERR_NO_AUTH);
        }

        $this->objMsgSet->upd($this->user_id, $param);

        return $this->getRes();
    }

}
